#include "../include/stu.h"

void change_s(){
    system("clear");
    printf("输入要修改的学生学号\n");
    char id1[15],name1[40];
    int num1,credit1,class1[10];
    struct student *p1;
    p1 = head1;
    scanf("%s",id1);
    while (p1 != NULL) {
        if (strcmp(p1->id,id1)==0){
            printf("输入：\n");
            printf("姓名\t课程数\t课程\t学分\n");
            scanf("%s %d",name1,&num1);
            for(int i = 0; i<num1; i++){
                scanf("%d",&class1[i]);
            }
            scanf("%d",&credit1);
            strcpy(p1->name,name1);
            for(int i = 0; i<num1; i++){
                p1->class[i] = class1[i];
            }
            p1->credit = credit1;
            return ;
        }
        p1 = p1->next;
    }
    printf("学号不存在\n");
}
